package com.base;

public class MethodDemo01 {
    public static void main(String[] args) {
        MethodDemo01 methodDemo01 = new MethodDemo01();

        methodDemo01.printMax(2,1,3);
    }


    public void printMax (int ... num){
        if(num.length == 0){
            System.out.println("没有传递参数");
            return ;
        }
        int res = num[0];

        for(int i:num){
            if(i > res) res = i;
        }
        System.out.println("最大值是：" + res);

    }
}
